\(\int \frac {\cos (c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx\) [361]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 30 \[ \int \frac {\cos (c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\csc (c+d x)}{a d}-\frac {\log (\sin (c+d x))}{a d} \]

[Out]

-csc(d*x+c)/a/d-ln(sin(d*x+c))/a/d

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2915, 12, 45} \[ \int \frac {\cos (c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\csc (c+d x)}{a d}-\frac {\log (\sin (c+d x))}{a d} \]

[In]

Int[(Cos[c + d*x]*Cot[c + d*x]^2)/(a + a*Sin[c + d*x]),x]

[Out]

-(Csc[c + d*x]/(a*d)) - Log[Sin[c + d*x]]/(a*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2915

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2)*(c + (d/b)*x
)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, c, d, m, n}, x] && IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2,
 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {a^2 (a-x)}{x^2} \, dx,x,a \sin (c+d x)\right )}{a^3 d} \\ & = \frac {\text {Subst}\left (\int \frac {a-x}{x^2} \, dx,x,a \sin (c+d x)\right )}{a d} \\ & = \frac {\text {Subst}\left (\int \left (\frac {a}{x^2}-\frac {1}{x}\right ) \, dx,x,a \sin (c+d x)\right )}{a d} \\ & = -\frac {\csc (c+d x)}{a d}-\frac {\log (\sin (c+d x))}{a d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.73 \[ \int \frac {\cos (c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\csc (c+d x)+\log (\sin (c+d x))}{a d} \]

[In]

Integrate[(Cos[c + d*x]*Cot[c + d*x]^2)/(a + a*Sin[c + d*x]),x]

[Out]

-((Csc[c + d*x] + Log[Sin[c + d*x]])/(a*d))

Maple [A] (verified)

Time = 0.11 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.80

method result size
derivativedivides \(\frac {-\csc \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )\right )}{d a}\) \(24\)
default \(\frac {-\csc \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )\right )}{d a}\) \(24\)
parallelrisch \(\frac {2 \ln \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\sec \left (\frac {d x}{2}+\frac {c}{2}\right ) \csc \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d a}\) \(56\)
risch \(\frac {i x}{a}+\frac {2 i c}{a d}-\frac {2 i {\mathrm e}^{i \left (d x +c \right )}}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d a}\) \(70\)
norman \(\frac {-\frac {1}{2 a d}-\frac {\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d a}-\frac {\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d a}-\frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d a}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}\) \(147\)

[In]

int(cos(d*x+c)^3*csc(d*x+c)^2/(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d/a*(-csc(d*x+c)+ln(csc(d*x+c)))

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.13 \[ \int \frac {\cos (c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) \sin \left (d x + c\right ) + 1}{a d \sin \left (d x + c\right )} \]

[In]

integrate(cos(d*x+c)^3*csc(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

-(log(1/2*sin(d*x + c))*sin(d*x + c) + 1)/(a*d*sin(d*x + c))

Sympy [F(-1)]

Timed out. \[ \int \frac {\cos (c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**3*csc(d*x+c)**2/(a+a*sin(d*x+c)),x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.97 \[ \int \frac {\cos (c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\frac {\log \left (\sin \left (d x + c\right )\right )}{a} + \frac {1}{a \sin \left (d x + c\right )}}{d} \]

[In]

integrate(cos(d*x+c)^3*csc(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

-(log(sin(d*x + c))/a + 1/(a*sin(d*x + c)))/d

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\frac {\log \left ({\left | \sin \left (d x + c\right ) \right |}\right )}{a} + \frac {1}{a \sin \left (d x + c\right )}}{d} \]

[In]

integrate(cos(d*x+c)^3*csc(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

-(log(abs(sin(d*x + c)))/a + 1/(a*sin(d*x + c)))/d

Mupad [B] (verification not implemented)

Time = 9.61 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.97 \[ \int \frac {\cos (c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}-\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )+\frac {1}{2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}}{a\,d} \]

[In]

int(cos(c + d*x)^3/(sin(c + d*x)^2*(a + a*sin(c + d*x))),x)

[Out]

-(log(tan(c/2 + (d*x)/2)) + tan(c/2 + (d*x)/2)/2 - log(tan(c/2 + (d*x)/2)^2 + 1) + 1/(2*tan(c/2 + (d*x)/2)))/(
a*d)